package com.ruoyi.frontend.controller;


import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.web.api.RemoteWebService;
import com.ruoyi.web.api.domain.TChapterCatagory;
import com.ruoyi.web.api.domain.TChapterCatagoryVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/frontend")
public class IndexController extends BaseController {

    @Resource
    private RemoteWebService remoteWebService;

    @GetMapping("/getCategoryList")
    public R<List<TChapterCatagory>> getCategoryList(){
        return remoteWebService.all();
    }

    @GetMapping("/getCategoryAndChapterList")
    public R<List<TChapterCatagoryVo>> getCategoryAndChapterList(){
        return remoteWebService.getCategoryAndChapters();
    }
}
